using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AudioManager : MonoBehaviour
{
    public static AudioManager instance;


    [Header("玩家音效")]
    public AudioSource playerAudioSource;
    [SerializeField]
    private AudioClip hitClip;//射击音效



    [Header("敌人音效")]
    public AudioSource enemyAudioSource;
    private void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this);
        }
        else
            instance = this;
    }

    private void Start()
    {
        playerAudioSource = Player.Player.instance.GetComponent<AudioSource>();
        hitClip = Resources.Load<AudioClip>("Sound/Player/shoot");
    }


    //播放玩家射击音效
    public void PlayPlayerShoot()
    {
        playerAudioSource.PlayOneShot(hitClip);
    }

}
